package com.berchen.算法.查找.分治算法;

/**
 * 汗洛塔
 */
public class HanRota {

    public static void main(String[] args) {

        hanRota(3,'A','B','C');

    }
    public static void hanRota(int num ,char a ,char b ,char c ){

        if(num==1){
            System.out.println("第 "+num+" 个圆盘，从 "+a+" -> "+c);
        }
        else {
            //
            hanRota(num-1,a,c,b);
            System.out.println("第 "+num+" 个圆盘，从 "+a+" -> "+c);
            hanRota(num-1,b,a,c);
        }
    }
}
